using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._3DFeatures._Conversion
{
    /// <summary>
    /// <para>Features From CityEngine Rules</para>
    /// <para>Generates 3D geometries  from existing 2D and 3D input features using rules authored in ArcGIS CityEngine.</para>
    /// <para>使用在 ArcGIS CityEngine 中创作的规则从现有 2D 和 3D 输入要素生成 3D 几何。</para>
    /// </summary>    
    [DisplayName("Features From CityEngine Rules")]
    public class FeaturesFromCityEngineRules : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FeaturesFromCityEngineRules()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>Input point, polygon, or multipatch features. Input features can be procedurally symbolized feature layers. Field mapping (attribute-driven symbol properties) will be honored.</para>
        /// <para>输入点、面或多面体要素。输入要素可以是按程序符号化的要素图层。字段映射（属性驱动的符号属性）将得到支持。</para>
        /// </param>
        /// <param name="_in_rule_package">
        /// <para>Rule Package</para>
        /// <para>The CityEngine rule package (*.rpk) file containing CGA rule information and assets. The rule annotated with @StartRule in the CityEngine rule package (.rpk) file should be annotated @InPoint for a rule package intended for point features, @InPolygon for a rule package intended for polygon features, or @InMesh for a rule package intended for multipatch features. If the @StartRule is not annotated with @InPoint, @InPolygon, or @InMesh, the feature type will be assumed to be polygon.</para>
        /// <para>包含 CGA 规则信息和资产的 CityEngine 规则包 （*.rpk） 文件。CityEngine 规则包 （.rpk） 文件中用 @StartRule 注注的规则应@InPoint用于用于点要素的规则包，@InPolygon用于面要素的规则包，或用于多面体要素的规则包@InMesh。如果未使用 @InPoint、@InPolygon 或 @InMesh 对@StartRule进行注记，则将假定要素类型为面。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Features</para>
        /// <para>The output feature class containing multipatch features with CGA rules applied. A field named OriginalOID is added to the output feature class(es) to contain the ObjectID of the input feature from which each output feature has been generated.</para>
        /// <para>包含应用了 CGA 规则的多面体要素的输出要素类。名为 OriginalOID 的字段将添加到输出要素类中，以包含生成每个输出要素的输入要素的 ObjectID。</para>
        /// </param>
        public FeaturesFromCityEngineRules(object _in_features, object _in_rule_package, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._in_rule_package = _in_rule_package;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Features From CityEngine Rules";

        public override string CallName => "3d.FeaturesFromCityEngineRules";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_features, _in_rule_package, _out_feature_class, _in_existing_fields.GetGPValue(), _in_include_reports.GetGPValue(), _in_leaf_shapes.GetGPValue(), _out_points, _out_lines, _out_multipoints];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>Input point, polygon, or multipatch features. Input features can be procedurally symbolized feature layers. Field mapping (attribute-driven symbol properties) will be honored.</para>
        /// <para>输入点、面或多面体要素。输入要素可以是按程序符号化的要素图层。字段映射（属性驱动的符号属性）将得到支持。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Rule Package</para>
        /// <para>The CityEngine rule package (*.rpk) file containing CGA rule information and assets. The rule annotated with @StartRule in the CityEngine rule package (.rpk) file should be annotated @InPoint for a rule package intended for point features, @InPolygon for a rule package intended for polygon features, or @InMesh for a rule package intended for multipatch features. If the @StartRule is not annotated with @InPoint, @InPolygon, or @InMesh, the feature type will be assumed to be polygon.</para>
        /// <para>包含 CGA 规则信息和资产的 CityEngine 规则包 （*.rpk） 文件。CityEngine 规则包 （.rpk） 文件中用 @StartRule 注注的规则应@InPoint用于用于点要素的规则包，@InPolygon用于面要素的规则包，或用于多面体要素的规则包@InMesh。如果未使用 @InPoint、@InPolygon 或 @InMesh 对@StartRule进行注记，则将假定要素类型为面。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Rule Package")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_rule_package { get; set; }


        /// <summary>
        /// <para>Output Features</para>
        /// <para>The output feature class containing multipatch features with CGA rules applied. A field named OriginalOID is added to the output feature class(es) to contain the ObjectID of the input feature from which each output feature has been generated.</para>
        /// <para>包含应用了 CGA 规则的多面体要素的输出要素类。名为 OriginalOID 的字段将添加到输出要素类中，以包含生成每个输出要素的输入要素的 ObjectID。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Include Existing Fields</para>
        /// <para><xdoc>
        ///   <para>Controls whether the output feature class inherits the attribute fields of the input feature class.
        ///   <bulletList>
        ///     <bullet_item>Checked—The attribute fields of the input feature class will be included in the output feature class. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—No attribute fields originating from the input feature class will be added to the output feature class. This option will be used automatically if the Export Leaf Shapes parameter is checked.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>控制输出要素类是否继承输入要素类的属性字段。
        ///   <bulletList>
        ///     <bullet_item>选中 - 输入要素类的属性字段将包含在输出要素类中。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 不会将源自输入要素类的属性字段添加到输出要素类中。如果选中了“导出叶子形状”参数，则将自动使用此选项。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include Existing Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _in_existing_fields_value _in_existing_fields { get; set; } = _in_existing_fields_value._true;

        public enum _in_existing_fields_value
        {
            /// <summary>
            /// <para>INCLUDE_EXISTING_FIELDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INCLUDE_EXISTING_FIELDS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DROP_EXISTING_FIELDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DROP_EXISTING_FIELDS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Include Reports</para>
        /// <para><xdoc>
        ///   <para>Depending on how the rule package has been authored, it may contain logic that generates one or more reports as the models are created. These reports can hold a wide variety of information about the features. An example is a rule package that reports the number of windows generated for each building model. This parameter is ignored if the rule package does not contain logic to generate reports.
        ///   <bulletList>
        ///     <bullet_item>Checked—New attribute fields are created on the output feature class to hold reported value for each feature as defined by the rule package report generation logic. A unique attribute is created for each reported value.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Reports generated within the rule package are ignored, and no new attributes relating to these reports are generated. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>根据规则包的创作方式，它可能包含在创建模型时生成一个或多个报告的逻辑。这些报告可以包含有关功能的各种信息。例如，一个规则包，它报告为每个建筑模型生成的窗口数。如果规则包不包含用于生成报告的逻辑，则忽略此参数。
        ///   <bulletList>
        ///     <bullet_item>选中 - 将在输出要素类上创建新属性字段，以保存规则包报告生成逻辑所定义的每个要素的报告值。为每个报告的值创建一个唯一的属性。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 将忽略规则包中生成的报告，并且不会生成与这些报告相关的新属性。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include Reports")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _in_include_reports_value _in_include_reports { get; set; } = _in_include_reports_value._false;

        public enum _in_include_reports_value
        {
            /// <summary>
            /// <para>INCLUDE_REPORTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INCLUDE_REPORTS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>EXCLUDE_REPORTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXCLUDE_REPORTS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Export Leaf Shapes</para>
        /// <para><xdoc>
        ///   <para>CityEngine rule packages construct content by generating component pieces and merging them together into a single 3D object. However, it is also possible to store these components, or leaf shapes, as separate features. This option can be especially important for running analytical operations against subelements of a 3D object, such as the windows of a building.</para>
        ///   <para>This parameter determines whether each input feature is one of the following:
        ///   <bulletList>
        ///     <bullet_item>Converted into a single, merged, multipatch feature  </bullet_item><para/>
        ///     <bullet_item>Becomes a set of many features that can be points, lines, or multipatches  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>For example, a rule may generate seamless building models from input polygon footprints, or alternatively, it could create separate features for each apartment face, including an outward-facing panel, a representative center point, and lines showing the borders. In this example, the apartment panels, center points, and outlines are all considered leaf shapes.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Checked—Additional output feature classes are generated. This is the default. The attribute fields from the input feature class are not included in the output feature class. The output feature class contains a field named OriginalOID that references the ObjectID of the input feature from which the output was generated.</bullet_item><para/>
        ///       <bullet_item>Unchecked—Additional output feature classes are not generated, even if additional leaf shapes are defined in the logic of the rule. All of the geometry is contained within the output multipatch features.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>CityEngine 规则包通过生成组件片段并将它们合并到单个 3D 对象中来构建内容。但是，也可以将这些组件或叶形存储为单独的特征。此选项对于针对 3D 对象的子元素（如建筑物的窗户）运行分析操作尤为重要。</para>
        /// <para>此参数确定每个输入要素是否为下列要素之一：
        ///   <bulletList>
        ///     <bullet_item>转换为单个、合并的多面体要素</bullet_item><para/>
        ///     <bullet_item>成为一组包含许多要素的要素，这些要素可以是点、线或多面体</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>例如，规则可以从输入面覆盖区生成无缝建筑模型，或者，它可以为每个公寓面创建单独的要素，包括朝外面板、代表性中心点和显示边界的线。在此示例中，单元面板、中心点和轮廓都被视为叶形状。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>选中 - 生成其他输出要素类。这是默认设置。输入要素类中的属性字段不包括在输出要素类中。输出要素类包含一个名为 OriginalOID 的字段，该字段引用从中生成输出的输入要素的 ObjectID。</bullet_item><para/>
        ///       <bullet_item>未选中 - 即使在规则逻辑中定义了其他叶片形状，也不会生成其他输出要素类。所有几何都包含在输出多面体要素中。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Export Leaf Shapes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _in_leaf_shapes_value _in_leaf_shapes { get; set; } = _in_leaf_shapes_value._false;

        public enum _in_leaf_shapes_value
        {
            /// <summary>
            /// <para>FEATURE_PER_LEAF_SHAPE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FEATURE_PER_LEAF_SHAPE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>FEATURE_PER_SHAPE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FEATURE_PER_SHAPE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Point Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Point Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_points { get; set; }


        /// <summary>
        /// <para>Output Line Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Line Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_lines { get; set; }


        /// <summary>
        /// <para>Output Multipoint Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Multipoint Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_multipoints { get; set; }


        public FeaturesFromCityEngineRules SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}